import { createRouter, createWebHashHistory } from 'vue-router'
import layout from '@/views/Layout/index.vue'
import home from '@/views/home/index.vue'
const router = createRouter({
  routes:[
    {path:'/',
    component:layout,
    children:[
      {path:'',component:home},
      {path:'/category/:id',component:()=>import('@/views/category/index.vue')},
      {path:'/category/sub/:id',component:()=>import('@/views/category/sub.vue')},
      {path:'/goods/:id',component:()=>import('@/views/goods/index.vue')},
    ]
  },
    {path:'/login',component:()=>import('@/views/Login/index.vue')},
    {path:'/login/callback',component:()=>import('@/views/Login/callback.vue')}
  ],
  history:createWebHashHistory()
})

export default router